<h:panelGroup xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:t="http://myfaces.apache.org/tomahawk">

	<p:panelGrid columns="2" columnClasses="width30,width70" style="width:100%"
		rendered="#{!evokPatientBean.readonly}">
		<h:outputLabel value="#{msgs.empl_surname} *" />
		<p:inputText value="#{evokPatientBean.patient.surname}" label="#{msgs.empl_surname}"
			style="width:90%" maxlength="45" required="true"/>

		<h:outputLabel value="#{msgs.empl_name} *" />
		<p:inputText value="#{evokPatientBean.patient.name}" label="#{msgs.empl_name}"
			style="width:90%" maxlength="45" required="true"/>

		<h:outputLabel value="#{msgs.empl_birthday} *" />
		<p:calendar value="#{evokPatientBean.patient.birthday}" navigator="true" pattern="dd/MM/yyyy"
			label="#{msgs.empl_birthday}" required="true"
			showOn="button" />

		<h:outputLabel value="#{msgs.empl_birthplace} *" />
		<h:panelGrid columns="3" styleClass="tableNoBorder" width="100%">
			<p:selectOneMenu id="region" value="#{evokPatientBean.birthRegionId}" style="width:100;"  converter="longConverter">
				<f:selectItem itemLabel="" itemValue="" />
				<f:selectItems value="#{cityBean.regionList}" var="re" itemLabel="#{re.name}"
					itemValue="#{re.id}" />
				<p:ajax update="city,postcode" listener="#{evokPatientBean.birthRegionChange}" />
			</p:selectOneMenu>

			<p:selectOneMenu id="city" value="#{evokPatientBean.birthCityId}" converter="longConverter"
				required="true" label="#{msgs.empl_birthplace}"  style="width:100;">
				<f:selectItem itemLabel="" itemValue="" />
				<f:selectItems value="#{evokPatientBean.birthCityList}" var="ct" itemLabel="#{ct.name}"
					itemValue="#{ct.id}" />
				<p:ajax update="postcode" listener="#{evokPatientBean.birthCityChange}" />
			</p:selectOneMenu>

			<h:outputText value="#{evokPatientBean.birthPostcode}" id="postcode" />
		</h:panelGrid>

		<h:outputLabel value="#{msgs.empl_sex} *" />
		<p:selectOneMenu value="#{evokPatientBean.patient.sex}" required="true" label="#{msgs.empl_sex}">
			<f:selectItem itemLabel="" itemValue="" />
			<f:selectItems value="#{sessionEnum['Sex']}" var="re" itemLabel="#{re.name}"
				itemValue="#{re.value}" />
		</p:selectOneMenu>

		<h:outputLabel value="#{msgs.default_email}" />
		<p:inputText value="#{evokPatientBean.domainPatient.email1}"
			style="validator:checkemail(#{msgs.default_email});width:95%;" maxlength="40" />
			
		<h:outputLabel value="#{msgs.register_user}" />
		<p:inputText value="#{evokPatientBean.userName}" id="username" style="width:95%;" maxlength="40" />		
	</p:panelGrid>

	<p:panelGrid columns="2" columnClasses="width30,width70" style="width:100%"
		rendered="#{evokPatientBean.readonly}">
		<h:outputLabel value="#{msgs.empl_surname} " />
		<h:outputText value="#{evokPatientBean.patient.surname}" />

		<h:outputLabel value="#{msgs.empl_name}" />
		<h:outputText value="#{evokPatientBean.patient.name}" />

		<h:outputLabel value="#{msgs.empl_birthday}" />
		<h:outputText value="#{evokPatientBean.patient.birthday}" converter="dateConverter" />

		<h:outputLabel value="#{msgs.empl_birthplace}" />
		<h:panelGrid columns="3" styleClass="tableNoBorder" width="100%">
			<h:outputText value="#{evokPatientBean.birthCity.region.name}" />
			<h:outputText value="#{evokPatientBean.birthCity.name}" />
			<h:outputText value="#{evokPatientBean.birthCity.postCode}" />
		</h:panelGrid>

		<h:outputLabel value="#{msgs.empl_sex}" />
		<h:outputText value="#{evokPatientBean.patient.sex}" converter="enumConverter" enumName="Sex" />

		<h:outputLabel value="#{msgs.register_user}" />
		<h:outputText value="#{evokPatientBean.userName}" />
	</p:panelGrid>

	<p />

	<p:panelGrid style="width:100%" columns="2" columnClasses="width30,width70" cellpadding="3">
		<h:outputLabel value="#{msgs.evok_patient_createDate} *" />
		<p:calendar value="#{evokPatientBean.domainPatient.registDate}" navigator="true"
			label="#{msgs.evok_patient_createDate}" pattern="dd/MM/yyyy" showOn="button"
			required="true"/>

		<h:outputLabel value="#{msgs.empl_street}" />
		<p:inputText value="#{evokPatientBean.domainPatient.street}"
			style="width:90%" maxlength="80" />

		<h:outputLabel value="#{msgs.empl_liveplace}" />
		<h:panelGrid columns="3" styleClass="tableNoBorder" width="100%">
			<p:selectOneMenu id="region1" value="#{evokPatientBean.liveRegionId}" converter="longConverter">
				<f:selectItem itemLabel="" itemValue="" />
				<f:selectItems value="#{cityBean.regionList}" var="re" itemLabel="#{re.name}"
					itemValue="#{re.id}" />
				<p:ajax update="city1,postcode1" listener="#{evokPatientBean.liveRegionChange}" />
			</p:selectOneMenu>
			<p:selectOneMenu id="city1" value="#{evokPatientBean.liveCityId}" converter="longConverter"
				label="#{msgs.default_city}">
				<f:selectItem itemLabel="" itemValue="" />
				<f:selectItems value="#{evokPatientBean.liveCityList}" var="ct" itemLabel="#{ct.name}"
					itemValue="#{ct.id}" />
				<p:ajax update="postcode1" listener="#{evokPatientBean.liveCityChange}" />
			</p:selectOneMenu>
			<h:outputText value="#{evokPatientBean.livePostcode}" id="postcode1" />
		</h:panelGrid>

		<h:outputLabel value="#{msgs.evok_patient_code}" />
		<p:inputText value="#{evokPatientBean.domainPatient.code}" style="width:90%;" maxlength="40" />

		<h:outputLabel value="#{msgs.empl_oib}" />
		<p:inputText value="#{evokPatientBean.domainPatient.oib}" style="width:90%;" maxlength="11" />

		<h:outputLabel value="#{msgs.empl_jmbg}" />
		<p:inputText value="#{evokPatientBean.domainPatient.jmbg}" style="width:90%;" maxlength="13" />

		<h:outputLabel value="#{msgs.empl_remark}" />
		<p:inputTextarea value="#{evokPatientBean.domainPatient.remark}" rows="4" style="width:90%"
			maxlength="250" />
	</p:panelGrid>
</h:panelGroup>